export default function TodoInput({
  todoInput,
  onTodoInputChange,
  onTodoInputEnter,
}: {
  todoInput: string,
  onTodoInputChange: (value: string) => void,
  onTodoInputEnter: (value: string) => void,
}) {
  
  return (
    <div>
      <input
        value={todoInput}
        onChange={(e) => onTodoInputChange(e.target.value)}
        placeholder="please enter a todo"
        onKeyDown={(e ) => {
          if (e.key === 'Enter') {
            onTodoInputEnter(e.target.value)
          }
        }}
      ></input>
      
    </div>
  )
}